package creational.property.copy.shallow;

/**
 * 这是一个猴子类，他实现了 Cloneable 用于提供复制方法
 */
public class MonkeyC implements Cloneable {

    private String name;
    private String age;
    private Club club;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public Club getClub() {
        return club;
    }

    public void setClub(Club club) {
        this.club = club;
    }

    @Override
    protected Object clone() {
        Object objResult = null;

        try {
            objResult = super.clone();
        } catch (Exception ex) {
            ex.printStackTrace();
        }

        return objResult;
    }

    @Override
    public String toString() {
        return "MonkeyC{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                ", club=" + club +
                '}';
    }
}
